//
//  YDYMessage.m
//  DYChats
//
//  Created by 杨德勇 on 2016/9/12.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

#import "YDYMessage.h"

@implementation YDYMessage
-(NSString *)ip{
    if (_ip.length == 0) {
        _ip = ydy_host;
        
    }
    return _ip;
}
-(uint16_t)port{
    if (_port == 0) {
        _port = ydy_port;
    }
    return _port;
}
-(void)setMsgString:(NSString *)msgString{
    _msgString = msgString;
    _msgData = [msgString dataUsingEncoding:NSUTF8StringEncoding];
    
}
-(void)setMsgData:(NSData *)msgData{
    _msgData = msgData;
    _msgString = [[NSString alloc]initWithData:msgData encoding:NSUTF8StringEncoding];
}
@end
